We are migrating the bug tracker to github Issues. This is now the preferred way to report NASM bugs.
Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)
I think what is happening here is that upon the first definition of the section FREE it is assumed to follow after DATA2. Then the definition of DATA3, which explicitly follows DATA2, fails because only one of them may follow DATA2. The section names listed in the error message don't seem correct for this condition however. $ cat test.asm section FAT start_fat: section DATA1 follows=FAT start_data1: section DATA2 follows=DATA1 start_data2: section FREE start_free: section DATA3 follows=DATA2 start_data3: section FREE follows=DATA3 $ nasm -v NASM version 2.12.01 $ nasm test.asm nasm: fatal: sections DATA3 and DATA3 can't both follow section DATA2 $ newnasm -v NASM version 2.15rc0 compiled on Aug 21 2019 $ newnasm test.asm test.asm: fatal: sections DATA3 and DATA3 can't both follow section DATA2 $
I tried something else. Same error message, but I'm not sure what to make of it in this case. It seems wrong. (Maybe the follows=DATAEND before defining that section is silently downgraded to "follows=DATA2" and thus hits the error again?) $ newnasm test2.asm test2.asm: fatal: sections DATA3 and DATA3 can't both follow section DATA2 $ cat test2.asm section FAT start_fat: section DATA1 follows=FAT start_data1: section DATA2 follows=DATA1 start_data2: section FREE follows=DATAEND start_free: section DATA3 follows=DATA2 start_data3: section DATAEND follows=DATA3 start_dataend: $ nasm -v NASM version 2.12.01 $ nasm test2.asm nasm: fatal: sections DATA3 and DATA3 can't both follow section DATA2 $ newnasm -v NASM version 2.15rc0 compiled on Aug 21 2019 $ newnasm test2.asm test2.asm: fatal: sections DATA3 and DATA3 can't both follow section DATA2 $
This however works: $ cat test3.asm section FREE follows=DATAEND start_free: section DATAEND start_dataend: $ nasm -v NASM version 2.12.01 $ nasm test3.asm $ newnasm -v NASM version 2.15rc0 compiled on Aug 21 2019 $ newnasm test3.asm $
Another failing case: $ cat test4.asm section DATA2 start_data2: section FREE follows=DATAEND start_free: section DATAEND follows=DATA2 start_dataend: $ nasm -v NASM version 2.12.01 $ nasm test4.asm nasm: fatal: sections DATAEND and DATAEND can't both follow section DATA2 $ newnasm -v NASM version 2.15rc0 compiled on Aug 21 2019 $ newnasm test4.asm test4.asm: fatal: sections DATAEND and DATAEND can't both follow section DATA2 $